package thread;

public class ThreadDemo {
    public static void main(String[] args) {
        MyThread1 t1 = new MyThread1();
        MyThreab2 t2 = new MyThreab2();
        MyThread3 t3 = new MyThread3();
        /*
        启动线程是调用线程的start方法，而不是直接调用run方法。
        当线程调用start方法后就纳入了线程调度器中，一旦调度器分配时间片给当前
        线程，他的run方法会自动被调用
         */
        t1.start();
        t2.start();
        t3.start();
    }
}
class MyThread1 extends Thread{
    public void  run(){
        for (int i = 0 ; i < 1000 ; i++){
            System.out.println("你是谁啊");
        }
    }
}
class MyThreab2 extends Thread{
    public void  run(){
        for (int i = 0; i < 1000; i++) {
            System.out.println("我是查水表的");
        }
    }
}
class  MyThread3 extends  Thread{
    public void run(){
        for (int i = 0; i <1000 ; i++) {
            System.out.println("我是嫩跌");
        }
    }
}